import request from './request'
export default {
  // home组件 左侧表格数据获取
  getTableData(params) {
    return request({
      url: '/home/getTableData',
      method: 'get',
      data: params,
      mock: true,
    })
  },
  getCountData() {
    return request({
      url: '/home/getCountData',
      method: 'get',
      mock: true,
    })
  },
  getEchartData() {
    return request({
      url: '/home/getChartsData',
      method: 'get',
      mock: true,
    })
  },

  // table
  getUserData(params) {
    return request({
      url: '/user/getUser',
      method: 'get',
      mock: false,
      data: params,
    })
  },

  // 表单增加
  addUser(params) {
    return request({
      url: '/user/add',
      method: 'post',
      mock: false,
      data: params,
    })
  },
  // 表单修改
  editUser(params) {
    return request({
      url: '/user/edit',
      method: 'post',
      mock: false,
      data: params,
    })
  },
  // 表单删除
  deleteUser(params) {
    return request({
      url: '/user/delete',
      method: 'get',
      mock: false,
      data: params,
    })
  },

  // 根据用户不同返回不同菜单
  getMenu(params) {
    return request({
      url: '/permission/getMenu',
      method: 'post',
      mock: false,
      data: params,
    })
  },

  getShopData(params) {
    return request({
      url: '/shop/getshop',
      method: 'get',
      mock: false,
      data: params,
    })
  },
}
